 //Initialize Select2 Elements


function commitDev(){
	var vForm = $("#infoDetail");
	validate.init(vForm,mind);
}

function mind(){
	getModal.show({content:'确定提交？',cb_l:cb});
}

function cb(){
	var dataStr = $("#infoDetail").serializeArray();
	var param = {};
    $.each(dataStr,function(i,v){
    	param[v.name] = v.value;
    })  
    console.log(param)
	$.ajax({
		url:'/dev/insertDeveloper',
		type:'POST',
		data:param,
	}).done(function(res){
		if(res.success){
			var msg = "操作成功";
			if(!$("#id").val()){
				msg+=",appKey="+res.value;
			}
			toast.show(msg);
			returnDev();
		}else{
			toast.show(res.errorMsg);
		}
	}).fail(function(res){
		toast.show(res.errorMsg);
	})
}


function returnDev(){
	window.location = "/dev/searchDev";
}
function getDesKey(){
	
	var encryptType =$("#encryptType").val();
	if("b"==encryptType){
		
		$("#publicKey").val(hex_md5(new Date().getTime()));
	}else{
		$("#publicKey").val('');
	}
}


